Skip to content

Conversation

@KallynGowdy
Copy link
Member

No description provided.

@KallynGowdy KallynGowdy added area:backend Is related to the backend server. (Everything in aux-records and aux-server/aux-backend) area:runtime Is related to the CasualOS runtime. (Everything in aux-runtime, aux-common, aux-vm, etc.) area:player Is related to the player frontend. (Everything in aux-server/aux-web/aux-player) area:auth Everything related to the Auth Frontend. (Everything in aux-server/aux-web/aux-auth) labels Apr 14, 2025
Comment on lines 887 to 893
_enabled: z
.boolean()
.optional()
.default(false)
.describe(
'Whether TigerBeetle is enabled, this allows for pre-defining and shipping default configuration.'
),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LandonSiler We don't need a flag for if tiger beetle is enabled. We can simply allow the tigerBeetle key in the server config to be null/undefined to disable it.

* Get an Xp user's meta data (Xp meta associated with an auth user)
* Creates an Xp user for the auth user if one does not exist
*/
async getXpUser(id: GetXpUserById): Promise<GetXpUserResult> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LandonSiler This function should receive the ID of the currently logged in user in addition to the the ID of the user that the metadata is requested for. This is so we can validate who is allowed to access the metadata for a user and what amount of metadata they can access.

For example, we will eventually start including account balances with these metadata requests, but we don't want to return the account balance for user A to user B.

} else return result;
}
return user
? { success: true, user }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LandonSiler Controllers should always try to be explicit about what they are returning so that we don't accidentally return more from the store than should be returned. For example, instead of:

return {
  success: true,
  user
};

I would prefer:

return {
  success: true,
  user: {
    id: user.id,
    accountId: user.accountId,
    // etc...
  }
};

so we can see exactly what is being returned from the controller without having to consult the store.

* Get a contract by its id
* @param id The id of the contract to get
*/
async getContractById(id: XpContract['id']): Promise<GetContractResult> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LandonSiler This function should also accept the current user ID so that we can validate whether the current user is allowed to access the given contract.

Comment on lines 1313 to 1324
await Promise.race([
client.lookupAccounts([0n]),
new Promise((_, rej) => {
setTimeout(() => {
rej(
new Error(
'Failed to connect to tigerbeetle server in time.'
)
);
}, 3000);
}),
]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LandonSiler We don't need to validate the tiger beetle connection on start. If we are having issues, then the server should start but each request should fail. This helps the system recover from temporary failures and not run into issues where we have to manually restart the server executable.

@KallynGowdy KallynGowdy force-pushed the feature/integrate-xp-contract branch from 4111dd0 to 7f6dd3b Compare May 13, 2025 21:12
@KallynGowdy KallynGowdy self-assigned this May 16, 2025
@CLAassistant
Copy link

CLAassistant commented Jun 10, 2025

CLA assistant check
All committers have signed the CLA.

KallynGowdy and others added 21 commits August 26, 2025 17:17
…nct features that were previously conflated:

- Portal map layers: Add GeoJSON overlays to the map/miniMap portals
- Bot map layers: Add overlays to individual bots with form: "map"

Update test suite
…tions to addBotMapLayer and removeBotMapLayer in BotEvents.ts
…rer-improvements-troyce

# Conflicts:
#	pnpm-lock.yaml
- Supports encryption, which is important for production environments
- Needs a more complete security review to ensure that proper safety controls are in place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:auth Everything related to the Auth Frontend. (Everything in aux-server/aux-web/aux-auth) area:backend Is related to the backend server. (Everything in aux-records and aux-server/aux-backend) area:player Is related to the player frontend. (Everything in aux-server/aux-web/aux-player) area:runtime Is related to the CasualOS runtime. (Everything in aux-runtime, aux-common, aux-vm, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants